<?php
require_plugins('simple_html_dom.php');
class article__meiriyiwenCom_apiBase extends apiBase {
    function __construct() {
        $this->baseUrl='http://meiriyiwen.com/';
    }
    
    /**
      *  获取某个星座某天的运势数据 
      */
    function getArticle(){
        $url=$this->baseUrl;
        $html = file_get_html($url);
        $rst=array('title'=>'','author'=>'','content'=>'');
        $rst['title']=unicode_encode($html->find('#article_center',0)->find('h1',0)->plaintext);
        $rst['author']=unicode_encode($html->find('#article_center',0)->find('.article_author',0)->plaintext);
        foreach($html->find('.article_text',0)->find('p') as $row){
            $rst['content'].=sprintf('<p>'.unicode_encode($row->plaintext).'</p>');
        }
        
        return $rst;
    }
    
}
?>